Termination w.r.t. Q of the following Term Rewriting System could be proven:

Q restricted rewrite system:
The TRS R consists of the following rules:

+(x, 0) → x
+(0, x) → x
+(s(x), s(y)) → s(s(+(x, y)))
+(+(x, y), z) → +(x, +(y, z))
*(x, 0) → 0
*(0, x) → 0
*(s(x), s(y)) → s(+(*(x, y), +(x, y)))
*(*(x, y), z) → *(x, *(y, z))
app(nil, l) → l
app(cons(x, l1), l2) → cons(x, app(l1, l2))
sum(nil) → 0
sum(cons(x, l)) → +(x, sum(l))
sum(app(l1, l2)) → +(sum(l1), sum(l2))
prod(nil) → s(0)
prod(cons(x, l)) → *(x, prod(l))
prod(app(l1, l2)) → *(prod(l1), prod(l2))

Q is empty.


QTRS
  ↳ DirectTerminationProof

Q restricted rewrite system:
The TRS R consists of the following rules:

+(x, 0) → x
+(0, x) → x
+(s(x), s(y)) → s(s(+(x, y)))
+(+(x, y), z) → +(x, +(y, z))
*(x, 0) → 0
*(0, x) → 0
*(s(x), s(y)) → s(+(*(x, y), +(x, y)))
*(*(x, y), z) → *(x, *(y, z))
app(nil, l) → l
app(cons(x, l1), l2) → cons(x, app(l1, l2))
sum(nil) → 0
sum(cons(x, l)) → +(x, sum(l))
sum(app(l1, l2)) → +(sum(l1), sum(l2))
prod(nil) → s(0)
prod(cons(x, l)) → *(x, prod(l))
prod(app(l1, l2)) → *(prod(l1), prod(l2))

Q is empty.

We use [23] with the following order to prove termination.

Lexicographic path order with status [19].
Quasi-Precedence:
app2 > cons2 > *2 > +2 > s1 > [sum1, prod1]
app2 > cons2 > *2 > 0 > [sum1, prod1]
nil > 0 > [sum1, prod1]
nil > s1 > [sum1, prod1]

Status:
+2: [1,2]
app2: [2,1]
sum1: [1]
0: multiset
s1: [1]
prod1: [1]
nil: multiset
cons2: [2,1]
*2: [1,2]